import { theme } from "../theme.js";

/**
 * VideoPlayer 组件样式
 * 提供视频播放器的完整样式，包括播放控制、进度条、指示器、响应式设计等
 */
export const css = `
/* 视频播放器主容器 - 设置基础布局和视觉效果 */
.video-player {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 视频容器 - 控制视频的布局和变换效果 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 视频元素 - 实际的视频标签样式 */
.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

/* 视频覆盖层 - 显示播放控制和交互元素 */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 覆盖层显示控制状态 */
.video-overlay.show-controls {
    opacity: 1;
    pointer-events: auto;
}

/* 播放/暂停按钮 - 中央控制按钮样式 */
.play-pause-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 播放按钮悬停状态 */
.play-pause-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

/* 播放和暂停图标样式 */
.play-icon,
.pause-icon {
    font-size: 32px;
    color: #333;
    transition: all 0.2s ease;
}

/* 暂停图标默认隐藏 */
.pause-icon {
    display: none;
}

/* 播放状态控制 - 根据播放状态切换图标显示 */
.video-overlay.playing .play-icon {
    display: none;
}

.video-overlay.playing .pause-icon {
    display: block;
}

/* 进度条容器 - 显示视频播放进度 */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* 进度填充条 - 实际的进度显示 */
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0 2px 2px 0;
}

/* 视频指示器容器 - 右侧的视频切换指示器 */
.video-indicators {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
}

/* 单个指示器样式 */
.indicator {
    width: 4px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 指示器悬停状态 */
.indicator:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

/* 指示器激活状态 */
.indicator.active {
    background: #fff;
    height: 30px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 滚动提示容器 - 提示用户可以滚动切换视频 */
.scroll-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 12px;
    opacity: 0.7;
    z-index: 20;
    animation: fadeInOut 3s ease-in-out infinite;
}

/* 滚动图标 - 带有弹跳动画的图标 */
.scroll-icon {
    font-size: 24px;
    animation: bounce 2s ease-in-out infinite;
}

/* 滚动提示文字 */
.scroll-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* 切换动画 - 视频切换时的滑动效果 */
.slide-down {
    animation: slideDown 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* 向下滑动动画关键帧 */
@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 向上滑动动画关键帧 */
@keyframes slideUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 弹跳动画关键帧 - 滚动图标的弹跳效果 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 淡入淡出动画关键帧 - 滚动提示的呼吸效果 */
@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.3;
    }
}

/* 响应式设计 - 平板设备适配 (768px以下) */
@media (max-width: 768px) {
    .video-player {
        border-radius: 8px;
    }
    
    .video-element {
        border-radius: 8px;
    }
    
    .play-pause-btn {
        width: 60px;
        height: 60px;
    }
    
    .play-icon,
    .pause-icon {
        font-size: 24px;
    }
    
    .video-indicators {
        right: 15px;
        gap: 10px;
    }
    
    .indicator {
        width: 3px;
        height: 16px;
    }
    
    .indicator.active {
        height: 24px;
    }
    
    .scroll-hint {
        top: 15px;
        right: 15px;
        font-size: 11px;
    }
    
    .scroll-icon {
        font-size: 20px;
    }
}

/* 响应式设计 - 移动设备适配 (480px以下) */
@media (max-width: 480px) {
    .video-player {
        border-radius: 6px;
    }
    
    .video-element {
        border-radius: 6px;
    }
    
    .play-pause-btn {
        width: 50px;
        height: 50px;
    }
    
    .play-icon,
    .pause-icon {
        font-size: 20px;
    }
    
    .video-indicators {
        right: 12px;
        gap: 8px;
    }
    
    .indicator {
        width: 2px;
        height: 14px;
    }
    
    .indicator.active {
        height: 20px;
    }
    
    .scroll-hint {
        top: 12px;
        right: 12px;
        font-size: 10px;
    }
    
    .scroll-icon {
        font-size: 18px;
    }
}

/* 响应式设计 - 横屏模式适配 (高度500px以下) */
@media (orientation: landscape) and (max-height: 500px) {
    .scroll-hint {
        top: 10px;
        font-size: 10px;
    }
}

/* 暗色主题适配 - 系统暗色模式下的样式调整 */
@media (prefers-color-scheme: dark) {
    .play-pause-btn {
        background: rgba(255, 255, 255, 0.8);
    }
    
    .play-pause-btn:hover {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* 高对比度模式适配 - 提高文字和元素的对比度 */
@media (prefers-contrast: high) {
    .scroll-text {
        text-shadow: 0 0 4px rgba(0, 0, 0, 1);
    }
    
    .indicator {
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
    
    .indicator.active {
        border-color: #fff;
    }
}

/* 减少动态效果偏好 - 为有动画敏感的用户禁用动画 */
@media (prefers-reduced-motion: reduce) {
    .video-container,
    .play-pause-btn,
    .indicator,
    .progress-fill {
        transition: none;
    }
    
    .slide-down,
    .slide-up {
        animation: none;
    }
    
    .scroll-icon {
        animation: none;
    }
    
    .scroll-hint {
        animation: none;
        opacity: 0.7;
    }
}

/* 焦点样式 - 键盘导航时的可访问性样式 */
.play-pause-btn:focus,
.indicator:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* 视频加载状态 - 无视频源时的占位样式 */
.video-element:not([src]) {
    background: linear-gradient(45deg, #333, #555);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
}

/* 加载动画关键帧 - 斜纹背景移动效果 */
@keyframes loading {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}
`;